package org.lanlab.storode.dal.entity;

/**
 * @author dove
 * @since 2020/1/8 17:16
 */
public enum RequirementState {
    // initialization
    INIT(0, "Initialization"),
    // under development
    UNDER_DEV(1, "Under development"),
    // unknown state
    UNKNOWN(100, "Unknown state");
    Integer code;
    String description;

    RequirementState(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static RequirementState getByCode(Integer code) {
        for (RequirementState value : RequirementState.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return UNKNOWN;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
